<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
	<head>
		<title>Simple Activity Harness</title>
		<meta http-equiv="Content-Language" content="en-us">
		<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
		<SCRIPT LANGUAGE="javascript">
			function Channel_OnTypeChanged() {
				alert("Channel changed to " + window.external.Channel.Type);
			}
			
			function Channel_OnRemoteAppLoaded()
			{
				alert("Remote App Loaded");
			}
			
			function Channel_OnRemoteAppClosed()
			{
				alert("Remote App Closed");
			}
			
			function Channel_OnAppClose()
			{
				alert("Remote App or Conversation Closed");
			}

			function Channel_OnDataReceived()
			{
				alert("Received data: " + window.external.Channel.Data);
			}

			function Channel_OnDataError() 
			{
			    alert("Data Error");
			}

			function SafeSendData(toSend) 
			{
				try {
					window.external.Channel.SendData(toSend);
				}
				catch (ex) {
					alert("SafeSendData failed. " + ex.description);
				}
			}

			window.external.Channel.Initialize();			
		</SCRIPT>
	</head>
	<body>
		Data:<input type=text id="data" />
		<input type=button id="send" onclick="SafeSendData(document.all('data').value)" value="Send" />
	</body>
</html>
